import React from 'react';
const ReactMarkdown = require('react-markdown')
import {isUndefined} from '../../utils/Tools';

import ReactMixin from 'react-mixin';
import Reflux from 'reflux';
import Store from './store';
import Actions from './action';

import Text from './arts/node.md';


import './style/index.scss';//引入样式文件

class Home extends React.Component{

    constructor(props){
        super(props);

        this.state = {
            content: ''
        };

        this.phone = null;

        const id = this.props.params.id || 0;
        this.id = id;
    }

    componentDidMount(){
        if (+this.id === 1) {
            this.setState({
                content: Text
            })
        }
    }
    render(){
        return <div className="book-container">
            <div className="content-container">
                <div className="article">
                    <ReactMarkdown source={this.state.content} />
                </div>
            </div>
        </div>
    }
}

ReactMixin.onClass(Home, Reflux.connect(Store,"home"));

export default Home;

